<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>印章管理</title>
</head>
<body class="layui-layout-body">
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="body_right">
            <h4 class="nav_title">印章管理
            	<a href="javascript:openwinx('添加印章','/admin/model/form.htm','600','250');" class="add_btn">添加</a>
            </h4>
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
		       
	        	<div class="layui-tab-content">
	        		<table class="layui-table  layui-form" mytable" lay-even="" lay-skin="nob">
			                <thead>
			                <tr>
			                    <th>设备型号</th>
			                    <th>设备数量</th>
			                    <th>当前版本</th>
			                    <th>已升级</th>
			                    <th>驱动路径</th>
			                    <th>升级时间</th>
			                    <th>操作</th>
			                </tr>
			                </thead>
			                <tbody>
			                		<#list models as item>
				                    <tr>
				                        <td>${item.model}</td>
				                        <td>${item.devicesTotal}</td>
				                        <td>${item.version}</td>
				                        <td>${item.upgradeTotal}</td>
				                        <td><a href="${item.drivePath}">下载</a></td>
				                         <td>
				                         	<#if item.upgradeTime??>
				                         		${item.upgradeTime?string('yyyy-MM-dd HH:mm:ss')}
				                         	</#if>
				                         </td>
				                        <td class="allbox_a">
				                        <a href="javascript:openwinx('添加印章','/admin/model/upgrade.htm?modelId=${item.model}','600','450');">升级</a>
				                        </td>
				                    </tr>
				                    </#list>
			                </tbody>
			            </table>
    			</div>
    		</div>
        </div>
     </div>
<script>
layui.use(['upload','element'], function(){
  	  var $ = layui.jquery ,upload = layui.upload,element = layui.element;
  
	  //普通图片上传
	  var uploadInst = upload.render({
	    elem: '#upload'
	    ,exts:'xls'
	    ,url: '/admin/devices/imports.htm'
	    ,done: function(res){
	      
	      if(res.code == 1){
	         layer.msg(res.msg);
	      }else{
	      	layer.msg(res.msg);
	      }
	     
	    }
	    ,error: function(){
	      
	    }
	  });
	  
	  
	  $("#setting").click(function(){
	  
	  		var $checked  = $("input:checkbox[name='devicesId']:checked");
	  		if($checked.length == 0){
	  			layer.msg('请选择设备');
	  		}else{
	  			openwinx('选择公司','/admin/devices/select.htm',600,400)
	  		}
	  		
	  })
	  
	  element.on('tab(docDemoTabBrief)', function(elem){
	  		var id = $(this).attr('lay-id');
	  		if(id == 'EFFECTIVE'){
	  		 	location.href='/admin/devices/effeList.htm';
	  		}
	  		
	  		if(id == 'DESERTED'){
	  			location.href='/admin/devices/deadList.htm';
	  		}
	  });
	  
  
});
</script>
</body>
</html>